from Eblob.HTable.BaseTable import Table


class Address(Table):
    def __init__(self):
        Table.__init__(self)
        self._country = Table.Cell('address')
        self._province = Table.Cell('address')
        self._city = Table.Cell('address')
        self._countryside = Table.Cell('address')
        self._town = Table.Cell('address')
        self._info = Table.Cell('address')
        self._phone = Table.Cell('address')


class Country(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('country')

        self._province = Table.OneToManyCell('Province')


class Province(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('province')

        self._city = Table.OneToManyCell('City')


class City(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('city')

        self._countryside = Table.OneToManyCell('Countryside')


class Countryside(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('countryside')

        self._town = Table.OneToManyCell('Town')


class Town(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('town')


class Seller(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('seller')
        self._password = Table.Cell('seller')
        self._phone = Table.Cell('seller')
        self._head = Table.Cell('seller')

        self._shop = Table.OneToOneCell('Shop')


class Shop(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('shop')
        self._script = Table.Cell('shop')
        self._Seller = Table.Cell('shop')

        self._goods = Table.OneToManyCell('Goods')
        self._assistants = Table.OneToManyCell('Assistants')


class Assistants(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('assistants')
        self._phone = Table.Cell('assistants')
        self._password = Table.Cell('assistants')
        self._head = Table.Cell('assistants')
        self._shop = Table.Cell('assistants')


class Goods(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('goods')
        self._price = Table.Cell('goods')
        self._pic = Table.Cell('goods')
        self._script = Table.Cell('goods')
        self._info = Table.Cell('goods')
        self._shop = Table.Cell('goods')


class OneShoppingCart(Table):
    def __init__(self):
        Table.__init__(self)
        self._count = Table.Cell('oneShoppingCart')
        self._goods = Table.Cell('oneShoppingCart')


class OneOrder(Table):
    def __init__(self):
        Table.__init__(self)
        self._count = Table.Cell('oneOrder')
        self._address = Table.Cell('oneOrder')
        self._goods = Table.Cell('oneOrder')


class Wallet(Table):
    def __init__(self):
        Table.__init__(self)
        self._balance = Table.Cell('wallet')

        self._cards = Table.OneToManyCell('Card')


class Card(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('card')
        self._belong = Table.Cell('card')
        self._discount = Table.Cell('card')


class User(Table):
    def __init__(self):
        Table.__init__(self)
        self._name = Table.Cell('user')
        self._password = Table.Cell('user')
        self._phone_number = Table.Cell('user')
        self._email = Table.Cell('user')
        self._head = Table.Cell('user')
        
        self._order = Table.OneToManyCell('OneOrder')
        self._favorite = Table.ManyToManyCell('Goods')
        self._address = Table.OneToManyCell('Address')
        self._wallet = Table.OneToOneCell('Wallet')
        self._shoppingCart = Table.OneToManyCell('OneShoppingCart')
